attribute vec3 vertex_pos;
attribute vec3 vertex_norm;

uniform vec3 offset;
uniform float scale;
uniform mat4 rotation;
//uniform vec2 xy_translation;
//uniform mat4 projection;

varying vec3 out_norm;
varying vec3 out_pos;

void main(void)
{
//    vec4 v = vec4(vertex_pos*scale + offset, 1.0);
//    v = rotation*v;

//    gl_Position = projection*(v + vec4(xy_translation, 0.0, 0.0));
////    gl_Position = v + vec4(xy_translation, 0.0, 0.0);

//    out_norm = vec3(rotation*vec4(vertex_norm, 0.0));

    vec3 v = (vertex_pos + offset)*scale;
    gl_Position = rotation*vec4(v, 1.0);

//    out_norm = vertex_norm;
    out_norm = normalize(vec3(rotation*vec4(vertex_norm, 0.0)));
    out_pos = vec3(gl_Position);
}
